package org.jash.learnmvp.video;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.MediaController;
import android.widget.VideoView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import org.jash.learnmvp.R;

public class VideoPlayerActivity extends AppCompatActivity {
    private VideoView video;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_player);
        video = findViewById(R.id.video);
        String url = getIntent().getStringExtra("url");
        video.setVideoPath(url);
        video.setOnPreparedListener(MediaPlayer::start);
        video.setMediaController(new MediaController(this));
    }
}